feat(params): Add support for optional parameters in targets#215
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for optional parameters in build targets, allowing targets to define parameters that are not required for execution. The change refactors the parameter model to distinguish between required and optional parameters throughout the system.
- Replaced
RequiredParamswith a unifiedParamscollection that tracks both required and optional parameters - Added new
UsedParamandDefinedParamrecords to encapsulate parameter requirements - Introduced
UsesParam()method for defining optional parameters alongside existingRequiresParam()method
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| DecSm.Atom/Build/Model/UsedParam.cs | New record to wrap parameter models with requirement flag |
| DecSm.Atom/Build/Model/TargetModel.cs | Updated to use unified Params collection instead of RequiredParams |
| DecSm.Atom/Build/Definition/DefinedParam.cs | New record for parameter definitions with requirement flag |
| DecSm.Atom/Build/Definition/TargetDefinition.cs | Added UsesParam method and refactored to use unified parameter collection |
| DecSm.Atom/Build/BuildResolver.cs | Updated parameter resolution to handle required/optional distinction |
| DecSm.Atom/Build/BuildExecutor.cs | Modified validation to only check required parameters |
| DecSm.Atom/Help/HelpService.cs | Updated help generation to handle new parameter structure |
| DecSm.Atom.Tool/Model.cs | Added FileOption for running individual files |
| DecSm.Atom.Tool/Commands/RunHandler.cs | Enhanced to support running individual atom files |
| DecSm.Atom.SourceGenerators/GenerateInterfaceMembersSourceGenerator.cs | Removed unused SimpleName method |
| DecSm.Atom.Module.GithubWorkflows/Generation/GithubWorkflowWriter.cs | Updated to use new parameter structure |
| DecSm.Atom.Module.DevopsWorkflows/Generation/DevopsWorkflowWriter.cs | Updated to use new parameter structure |
| DecSm.Atom.Tests/BuildTests/Params/OptionalParamBuild.cs | New test build demonstrating optional parameter usage |
| DecSm.Atom.Tests/BuildTests/Params/ParamTests.cs | Added test for optional parameter behavior |
| DecSm.Atom.Tests/ClassTests/Build/Model/BuildModelTests.cs | Updated test to use new Params property |
| DecSm.Atom.Tests/ClassTests/Build/Definition/TargetDefinitionTests.cs | Updated test to validate new parameter structure |
| DecSm.Atom.Tests/ClassTests/Build/BuildExecutorTests.cs | Updated test to use new Params property |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
f2cddbc to
af40b64
Compare
Introduced support for defining optional parameters in build targets. Updated `TargetDefinition` and associated models to differentiate between required and optional parameters. Adjusted related functionality in build execution, parameter validation, and workflow generation. Added tests to validate optional parameter behavior.
af40b64 to
975d464
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduced support for defining optional parameters in build targets. Updated
TargetDefinitionand associated models to differentiate between required and optional parameters. Adjusted related functionality in build execution, parameter validation, and workflow generation. Added tests to validate optional parameter behavior.